home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib16.dsk
/
BINARY DUMP.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
3KB
|
79 lines
1 REM **********************
2 REM * BINARY DUMP *
3 REM * BY TIM & TOM DAMON *
4 REM * COPYRIGHT (C) 1983 *
5 REM * BY MICROSPARC, INC *
6 REM * LINCOLN, MA. 01773 *
7 REM **********************
60 HOME
70 GOTO 110
80 PRINT :NM$ = STR$(X): GOSUB 700
85 IF LEN(CH$) <4 THEN CH$ = "0" +CH$: GOTO 85
87 RETURN
90 NM$ = STR$( PEEK(I)): GOSUB 700: PRINT CH$;" ";: RETURN
100 HTAB 20 - LEN(A$)/2 +1: PRINT A$: RETURN
110 INVERSE
120 HTAB 12: PRINT "******************": HTAB 12: PRINT "* *": HTAB 12: PRINT "* *": HTAB 12: PRINT "******************": VTAB 2: REM 16 SPACES IN THE LINES
130 NORMAL
140 A$ = " BINARY DUMP ": GOSUB 100
150 A$ = "BY TIMOTHY DAMON": GOSUB 100: VTAB 12: PRINT "** COPYRIGHT 1983 BY MICROSPARC, INC. **"
160 VTAB 23: PRINT "INSTRUCTIONS?": WAIT -16384,128
170 GET A$: IF A$ = "N" THEN 240
180 HOME : PRINT "THIS PROGRAM WILL DUMP OUT ANY BINARY PROGRAM IN HEXADECIMAL NUMBERS IN 16 COLUMNS."
190 VTAB 8
200 INVERSE :A$ = "HIT ANY KEY TO CONTINUE": GOSUB 100
210 WAIT -16384,128
220 NORMAL
230 POKE -16368,0
240 HOME : PRINT "ENTER THE STARTING ADDRESS OF THE PROGRAM IN HEXADECIMAL.": PRINT "IF YOU DON'T KNOW WHAT IT IS THEN TYPE IN 'END' AND FIND OUT!"
250 HX$ = "0123456789ABCDEF"
260 INPUT "ENTER ADDRESS: ";NM$: IF NM$ = "" THEN 260
270 IF NM$ = "END" THEN TEXT : HOME : END
280 GOSUB 610: IF BI = 1 THEN PRINT CHR$(7); CHR$(7);"INVALID INPUT":BI = 0: GOTO 260
290 SD = CH
300 PRINT : PRINT
310 PRINT "NOW ENTER THE LENGTH IN HEXADECIMAL.": PRINT "IF YOU DON'T KNOW THIS THEN TYPE IN 'END' AND FIND OUT!"
320 INPUT "ENTER LENGTH: ";NM$: IF NM$ = "" THEN 320
330 IF NM$ = "END" THEN TEXT : HOME : END
340 GOSUB 610: IF BI = 1 THEN PRINT CHR$(7); CHR$(7);"INVALID INPUT!":BI = 0: GOTO 320
350 LD = CH -1
360 PRINT : PRINT
370 HOME
380 PR# 1:X = SD: GOSUB 80: FOR ZZ = 1 TO LEN(CH$) +2: PRINT " ";: NEXT : PRINT "0 1 2 3 4 5 6 7 8 9 A B C D E F"
390 FOR ZZ = 1 TO LEN(CH$) +2: PRINT " ";: NEXT : PRINT "- - - - - - - - - - - - - - - -";
400 I = SD:W = SD -16 * INT(SD/16)
410 IF W = 0 THEN 470
420 GOSUB 80:CH$ = LEFT$(CH$,3) +"0"
430 PRINT CH$;"- "; SPC( W *3);
440 FOR I = I TO I +15 -W
450 GOSUB 90
460 NEXT I
470 FOR X = I TO SD +LD STEP 16
480 GOSUB 80
490 PRINT CH$;"- ";
500 FOR I = X TO X +15
510 GOSUB 90
520 IF I = SD +LD THEN 550
530 NEXT I
540 NEXT X
550 PRINT : PRINT
560 PR# 0
570 PRINT "ANY MORE? (Y/N)";: GET A$
580 IF A$ = "N" THEN TEXT : HOME : END
590 CLEAR
600 GOTO 240
610 CH = 0:WK = 0
620 FOR M = LEN(NM$) TO 1 STEP -1
630 FOR J = 1 TO 16
640 IF MID$ (NM$,M,1) = MID$ (HX$,J,1) THEN CH = CH +(J -1) *16 ^WK: GOTO 670
650 NEXT J
660 BI = 1: RETURN
670 WK = WK +1
680 NEXT M
690 RETURN
700 WK = VAL(NM$):CH$ = ""
710 DG = WK - INT(WK/16) *16:WK = INT(WK/16)
720 CH$ = MID$ (HX$,DG +1,1) +CH$
730 IF WK >0 THEN 710
740 IF LEN(CH$) <2 THEN CH$ = "0" +CH$
750 RETURN